import request from '@/utils/request'

// 查询试卷管理列表
export function listPaper(params) {
  return request({
    url: '/examination/paper/list',
    method: 'get',
    params
  })
}

// 查询试卷管理详细
export function getPaper(paperId) {
  return request({
    url: '/examination/paper/getInfo/' + paperId,
    method: 'get'
  })
}
// 新增试卷管理
export function addPaper(data) {
  return request({
    url: '/examination/paper',
    method: 'post',
    data: data
  })
}

// 修改试卷管理
export function updatePaper(data) {
  return request({
    url: '/examination/paper',
    method: 'put',
    data: data
  })
}

// 删除试卷管理
export function delPaper(paperId) {
  return request({
    url: '/examination/paper/delete/' + paperId,
    method: 'delete'
  })
}

// 查询试卷详情-试题列表
export function getPaperQuestionList(data) {
  return request({
    url: '/examination/question/editPaperlist',
    method: 'post',
    data
  })
}



// 查询试卷详情-试题列表（包含全部试题-标记已选）
export function paperIdByQuestionList(params) {
  return request({
    url: '/examination/question/editPaperlist',
    method: 'get',
    params
  })
}

// 获取当前登录人昵称（新增试卷获取出题人）
export function getPaperAuthorName(params) {
  return request({
    url: '/examination/paper/getPaperAuthorName',
    method: 'get',
    params
  })
}

// 试卷预览与考试试卷详情通用--选项中所有答案都设置为错误
export function showPaperList(id) {
  return request({
    url: '/examination/paper/show/' + id,
    method: 'get'
  })
}

// 发布试卷
export function publishPaper(data) {
  return request({
    url: '/examination/paper/push',
    method: 'put',
    data: data
  })
}
